# $Id: PKGBUILD 178390 2013-02-21 05:35:59Z heftig $
# Maintainer: Jan de Groot <jan@archlinux.org>
# Contributor: Tom K <tomk@runbox.com>
pkgname=opal
pkgver=3.10.10
pkgrel=1
pkgdesc="Open Phone Abstraction Library"
arch=(i686 x86_64)
url="http://www.opalvoip.org"
license=(GPL)
depends=(ptlib libtheora x264 speex gsm celt)
makedepends=(ffmpeg)
options=(!makeflags)
source=(http://ftp.gnome.org/pub/GNOME/sources/opal/${pkgver%.*}/opal-$pkgver.tar.xz
        opal-ffmpeg.patch)
sha256sums=('f208985003461b2743575eccac13ad890b3e5baac35b68ddef17162460aff864'
            'd81542907ace54015b7c69c275b0c67f449eeb252ba971ba6ca728a5e20db231')

build() {
  cd "${srcdir}/opal-${pkgver}"
  patch -Np1 -i "${srcdir}/opal-ffmpeg.patch"
  CXXFLAGS="$CXXFLAGS -fpermissive" \
  ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
  make
}

package() {
  cd "${srcdir}/opal-${pkgver}"
  make DESTDIR="${pkgdir}" install
  chmod 644 "${pkgdir}/usr/lib/libopal_s.a"
}
